<template>
    <div id="background">
        <el-container style="height:100%;">
            <el-header id="cuoTiHeadPosition">
                <el-row type="flex" style="height:80%;display:flex;align-items: flex-end">
                    <el-col :xs="2" :sm="2" :md="2" :offset="1" class="imgCol">
                        <img v-bind:src="backIcon" class="backSize" @click="back" />
                    </el-col>
                    <el-col :xs="6" :sm="6" :md="6" :offset="6" class="imgCol">
                        <span class="titleSize">我的错题</span>
                    </el-col>
                </el-row>
            </el-header>
            <el-main id="cuoTiMain">
                <el-row style="margin-top:15px;margin-bottom:25px;height:40px;">
                   <!-- <img class="ctCircle" src="../../assets/img/mine/cuotict.png"> -->
                   <span style="position:absolute;left:40%;">
                    <span style="font-size:20px;font-weight:500;color:#707070;">{{num}}</span>
                    <span style="font-size:16px;color:#b1b1b1;">/71</span>
                   </span>
                </el-row>
                <el-row  v-for="(value,key) in questionlist" :key="key" style="margin:10px;">
                    <el-row v-if="value.number==num">
                    <el-card class="ctQuestion" :body-style="{ padding: '10px'}" shadow="always">
                        <el-row style="font-size:14px;">
                            {{value.title}}
                        </el-row>
                        <el-row class="ctAnswer">
                            <!-- <div v-for="(choose,key) in value.choice" :key="key" style="margin-top: 10px;">
							<el-radio v-model="radio" :label="key" class="ctXuanXiang">{{choose}}</el-radio>
                            </div> -->
                            <van-radio-group v-model="radio" >
                                <van-radio name="A" style="margin-top: 5px;font-size:14px" checked-color="#53cdf5">
                                   <span>
                                    {{value.choice[0]}}
                                   </span>
                                </van-radio>
                                <van-radio name="B" style="margin-top: 5px;font-size:14px" checked-color="#53cdf5">
                                    <span>
                                    {{value.choice[1]}}
                                    </span>
                                </van-radio>
                                <van-radio name="C" style="margin-top: 5px;font-size:14px" checked-color="#53cdf5">
                                    <span>
                                    {{value.choice[2]}}
                                    </span>
                                </van-radio>
                                <van-radio name="D" style="margin-top: 5px;font-size:14px" checked-color="#53cdf5">
                                    <span>
                                    {{value.choice[3]}}
                                    </span>
                                </van-radio>
                            </van-radio-group>
                        </el-row>
                    </el-card>
                    </el-row>
                </el-row>
                <el-row style="position:fixed;bottom:30px;width:100%" type="flex">
                        <el-col :xs="10" :sm="10" :md="10"  class="imgCol" >
                            <span style="color:#53cdf5" @click="shangti">上一题</span>
                        </el-col>
                        <el-col :xs="4" :sm="4" :md="4" class="imgCol">
                             <el-divider direction="vertical"></el-divider>
                        </el-col >
                        <el-col :xs="10" :sm="10" :md="10" class="imgCol"  >
                            <span style="color:#53cdf5" @click="xiati">下一题</span>
                        </el-col>
                </el-row>
            </el-main>
        </el-container>

    </div>
</template>

<script>
import { RadioGroup, Radio } from 'vant';
import backIcon from '../../assets/img/mine/back.png'
export default {
     data() {
      return {
        backIcon:backIcon,
        normalHeight:document.documentElement.clientHeight,
        radio: '',
        customColor: '#97dff7',
        num:1,
        questionlist:[
            {
				type: '单选题',
				number: 1,
				title: 'IP中潜影信息的读出是通过（ ）',
				choice: [
					'A.X线曝光',
					'B.强光照射',
					'C.激光束扫射',
					'D.显定影处理',
					],
			},{
				type: '单选题',
				number: 2,
				title: '姓名（ ）',
				choice: [
					'A.张三',
					'B.李四',
					'C.王五',
					'D.小明',
					],
			},{
				type: '单选题',
				number: 3,
				title: 'IP中潜影信息的读出是通过（ ）',
				choice: [
				    'A.X线曝光',
					'B.强光照射',
					'C.激光束扫射',
					'D.显定影处理',
				    ],
			}
        ],
      };
    },
    mounted(){
        var bg = document.getElementById("background");
       // this.normalHeight=document.documentElement.clientHeight;
        console.log("height:"+this.normalHeight);
        bg.style.height = this.normalHeight+"px";
        bg.style.backgroundColor = "#FFFFFF"
        bg.style.margin = "0px";

        var head=document.getElementById("cuoTiHeadPosition");
        var headHeight=this.normalHeight/30 *4 ;
        console.log("headHeight:"+headHeight);
        head.style.height=headHeight+"px";

        var main=document.getElementById("cuoTiMain");
        var mainHeight=this.normalHeight/30 *24 ;
        main.style.height=mainHeight+"px";
    },
    methods:{
        shangti(){
            if(this.num!=1){
                this.num--;
                this.radio='';
            }else{
                console.log('已经是第一题了')
            }
        },
        xiati(){
            if(this.num<3){
                this.num++;
                this.radio='';
            }else{
                console.log('已经是最后一题了')
            }
        },
        back(){
            console.log("back:");
            this.$router.go(-1);
        },
    }

}
</script>

<style>
.el-radio__input.is-checked+.el-radio__label {
    color: #53cdf5;
}
#cuoTiHeadPosition {
  background-color: #53cdf5;
}
.backSize{
    height: 26px;
}
.titleSize{
    font-size:1.125em;
    color:#ffffff
}
@media screen and (max-height: 600px){
  .backSize{
      height: 22px;
  }
  .titleSize{
      font-size: 1em;
  }
}

.ctXuanXiang .el-radio__input.is-checked .el-radio__inner{
    border-color: #53cdf5;
    background: #53cdf5;
}

.xz{
    margin-top: 10px;
}
.st{
    position: relative;
    left:8%;
}
.xt{
    position: absolute;
    left: 72%;
}
.ctQuestion{
    /* position: relative; */
    /* top:50px; */
    border-radius: 10px;
}
.ctBackground{
    position: absolute;
    width:90%;
    height:40%;
    top:15px;
}
/* 
.ctCircle{
    position: absolute;
    left:38%;
    height: 85px;
    width: 88px;
} */


#cuoTiMain{
    padding: 0;
    background: #FFFFFF;
}
/* #cuoTiHead{
    background-color: #53cdf5 !important;
    height: 45px;
    text-align: center;
    line-height: 60px;
    color: #FFFFFF;
    width: 100%;
}
.ctIcon{
    position: relative;
    top:40%;
    float:left;
    width:30px;
    height:30px;
}
.ctHead{
    position: relative;
    top:15%;
    right: 8px;
    font-size: 20px;
} */

</style>
